package com.clusterswisdom.horn.api.tmall.action.alipay.free;

import com.taobao.api.domain.AlipayRecord;

public class CommissionCreatorh implements FreeCreator {
	
	public static final String TYPE_COMMISSION = "001";
	
	public static final String TITLE_COMMISSION = "天猫类目佣金";

	@Override
	public TmallFree getFree(AlipayRecord alipayrecord) {
		TmallFree free = new TmallFree();
		free.setOrderId(alipayrecord.getMemo().substring(9, alipayrecord.getMemo().length()-3));
		free.setFreeType(TYPE_COMMISSION);
		free.setTitle(TITLE_COMMISSION);
		free.setFree(Double.parseDouble(alipayrecord.getOutAmount()));
		
		return free;
	}

}
